package com.virtium.vpm.dao;

import javax.servlet.ServletContext;

public abstract class DAOFactory {   
	public abstract TypeDAO getTypeDAO(); 
	public abstract UserDAO getUserDAO();
	public abstract ProjectDAO getProjectDAO();
	public abstract MajorTaskDAO getMajorTaskDAO();
	
    private static DAOFactory instance;
    protected static ServletContext servletCtxt;
    
    public static void setCtxt(ServletContext ctxt){        
            servletCtxt = ctxt;
        
    }

    public static DAOFactory getInstance () {

        if (instance == null) {
        	
        	System.out.println("***********DAOFactory : LOADING &&&&&&&&&&&&&&");
            
            instance = new com.virtium.vpm.dao.hibernate.HibernateDAOFactory();
        }
        return instance;
    }
}